﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Maticsoft.DBUtility;
using System.Data.SqlClient;
using System.Collections;
using System.Data;

namespace RLZY.others
{
    class gzPrint
    {
        /// <summary>
        /// 根据日期打印工资
        /// </summary>
        public DataSet GetListGZ(string bm, String date)
        {
            StringBuilder strSql = new StringBuilder();
            //strSql.Append("select ");

            strSql.Append(" select 用工性质, [日期], [部门单位], [车间班组], [姓名],  [技能工资], [岗位工资], [绩效工资],  [三项补贴], [回贴], [工龄津贴], [职称津贴], [特岗津贴], [行车工津贴], [卫生纸费],  [中晚班费],  [加班工资], [补发],  [扣事假工资],  [扣病假工资],[其它扣款], [应发], [扣失业保险], [扣养老金], [扣医疗保险], [扣公积金], [扣电视费], [扣治安费], [扣会费], [扣互助金], [扣丧葬费], [实发]  from GZ ");
            //strSql.Append(" FROM GZ ");
            strSql.Append("  where 1=1 and (部门单位 like '%'+@strWhere+'%' or @strWhere='') and substring(日期,1,7)=@date ");
            strSql.Append("  order by 车间班组 asc ");

            SqlParameter[] param = new SqlParameter[] 
            { 
                new SqlParameter("@strWhere",bm),
                new SqlParameter("@date",date.Substring(0,7)),
            };

            return DbHelperSQL.Query(strSql.ToString(), param);

        }
        /// <summary>
        /// 根据日期打印工资2222
        /// </summary>
        public DataSet GetListGZ_2(string bm, String date)
        {
            StringBuilder strSql = new StringBuilder();
            //strSql.Append("select ");

            strSql.Append(" select  [日期], 用工性质, [部门单位], [车间班组], [姓名],  [技能工资], [岗位工资], [绩效工资],  [三项补贴], [回贴], [工龄津贴], [职称津贴], [特岗津贴], 行车工津贴,星级津贴,车贴,五项津贴, [卫生纸费],  [中晚班费],  [加班工资], [补发],  [扣事假工资],  [扣病假工资],  [其它扣款], [应发总额], [扣失业保险], [扣养老金], [扣医疗保险], [扣公积金], [扣电视费], [扣治安费], [扣会费], [扣互助金], [扣丧葬费],五项扣款, [实发金额]  from GZ  ");
            //strSql.Append(" FROM GZ ");
            strSql.Append("  where 1=1 and (部门单位 like '%'+@strWhere+'%' or @strWhere='') and substring(日期,1,7)=@date ");
            strSql.Append("  order by 车间班组,姓名 ");

            SqlParameter[] param = new SqlParameter[] 
            { 
                new SqlParameter("@strWhere",bm),
                new SqlParameter("@date",date.Substring(0,7)),
            };

            return DbHelperSQL.Query(strSql.ToString(), param);

        }
        /// <summary>
        /// 各部门工资汇总
        /// </summary>
        public int SumGZ(string bm,string date)
        {
            List<String> list = new List<string>();
            list.Add(" if  exists (select name from sysobjects where name='GZ11')  drop table GZ11  ");
            list.Add("  select  用工性质, sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发]) as 应发, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum([实发]) as 实发 into GZ11 from GZ  where 部门单位  like '%'+'" + bm + "'+'%' and substring(日期,1,7)='" + date.Substring(0, 7) + "'  group by 用工性质 ");
            list.Add(" if  exists (select name from sysobjects where name='GZ33')  drop table GZ33  ");
            list.Add(" select  sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发]) as 应发, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum([实发]) as 实发 into GZ33 from GZ where 部门单位  like '%'+'" + bm + "'+'%' and substring(日期,1,7)='" + date.Substring(0,7) + "'   ");
            list.Add("  alter table GZ33  add  用工性质  varchar(10) ");
            list.Add("   update GZ33 set 用工性质=' 总'  where 用工性质 is null ");
            list.Add("  insert into GZ11 select  用工性质,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴,  行车工津贴,  卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费,  实发 from GZ33  ");
            //list.Add("   ");
            //list.Add("   ");
            //list.Add("   ");
            //list.Add("   ");
            //list.Add("   ");

            return DbHelperSQL.ExecuteSqlTran(list);
        }
        /// <summary>
        /// 各部门工资汇总2
        /// </summary>
        public int SumGZ_2(string bm, string date)
        {
            List<String> list = new List<string>();
            list.Add(" if  exists (select name from sysobjects where name='GZ11')  drop table GZ11  ");
            list.Add("  select  用工性质, sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴,sum([星级津贴]) as 星级津贴,sum([车贴]) as 车贴,sum([五项津贴]) as 五项津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发总额]) as 应发总额, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum(五项扣款) as 五项扣款,sum([实发金额]) as 实发金额 into GZ11 from GZ where 部门单位  like '%'+'" + bm + "'+'%' and substring(日期,1,7)='" + date.Substring(0, 7) + "'  group by 用工性质 ");
            list.Add("  if  exists (select name from sysobjects where name='GZ33')  drop table GZ33  ");
            list.Add(" select  sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([星级津贴]) as 星级津贴,sum([车贴]) as 车贴,sum([五项津贴]) as 五项津贴,sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发总额]) as 应发总额, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费,sum(五项扣款) as 五项扣款, sum([实发金额]) as 实发金额 into GZ33 from GZ where 部门单位  like '%'+'" + bm + "'+'%' and substring(日期,1,7)='" + date.Substring(0, 7) + "'  ");
            list.Add("  alter table GZ33  add  用工性质  varchar(10) ");
            list.Add(" update GZ33 set 用工性质=' 总'  where 用工性质 is null  ");
            list.Add(" insert into GZ11 select  用工性质,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴,  行车工津贴,星级津贴, 车贴,五项津贴,  卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发总额,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费, 五项扣款, 实发金额 from GZ33    ");
            list.Add("   ");

            return DbHelperSQL.ExecuteSqlTran(list);
        }
        /// <summary>
        /// 获取各部门工资汇总
        /// </summary>
        public DataSet GetListGZSUM()
        {
            StringBuilder strSql = new StringBuilder();
            //strSql.Append("select ");

            strSql.Append(" select   * from GZ11   order by 用工性质 desc ");
            ////strSql.Append(" FROM GZ ");
            //strSql.Append("  where 1=1 and (部门单位 like '%'+@strWhere+'%' or @strWhere='') and substring(日期,1,7)=@date ");
            //strSql.Append("  order by 车间班组 asc ");

            //SqlParameter[] param = new SqlParameter[] 
            //{ 
            //    new SqlParameter("@strWhere",bm),
            //    new SqlParameter("@date",date.Substring(0,7)),
            //};

            return DbHelperSQL.Query(strSql.ToString(), null);

        }
        /// <summary>
        /// 获取分部门工资汇总
        /// </summary>
        public DataSet GetListGZSUMBYBM()
        {
            StringBuilder strSql = new StringBuilder();


            strSql.Append(" select   * from GZ21   order by 用工性质 desc ");
            

            return DbHelperSQL.Query(strSql.ToString(), null);

        }
        /// <summary>
        /// 各部门工资汇总
        /// </summary>
        public int SumGZBYBM(string bm, string date)
        {
            List<String> list = new List<string>();
            list.Add(" if  exists (select name from sysobjects where name='GZ21')  drop table GZ21 ");
            list.Add(" select  用工性质, sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发]) as 应发, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum([实发]) as 实发 into GZ21 from GZ where   部门单位  like '%'+'" + bm + "'+'%' and substring(日期,1,7)='" + date.Substring(0, 7) + "'  group by 用工性质 ");
            list.Add(" if  exists (select name from sysobjects where name='GZ23')  drop table GZ23  ");

            list.Add(" select  sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发]) as 应发, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum([实发]) as 实发 into GZ23 from GZ where    部门单位  like '%'+'" + bm + "'+'%' and substring(日期,1,7)='" + date.Substring(0, 7) + "'  ");
            list.Add(" alter table GZ23  add  用工性质  varchar(10)  ");
            list.Add("   update GZ23 set 用工性质=' 总'  where 用工性质 is null ");
            list.Add(" insert into GZ21 select  用工性质,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴,  行车工津贴,  卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费,  实发 from GZ23   ");
            //list.Add("   ");

            return DbHelperSQL.ExecuteSqlTran(list);
        }
        /// <summary>
        /// 各部门工资汇总2
        /// </summary>
        public int SumGZBYBM_2(string bm, string date)
        {
            List<String> list = new List<string>();
            list.Add(" if  exists (select name from sysobjects where name='GZ21')  drop table GZ21  ");
            list.Add("  select  用工性质, sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([星级津贴]) as 星级津贴,sum([车贴]) as 车贴, sum([五项津贴]) as 五项津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发总额]) as 应发总额, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum(五项扣款) as 五项扣款, sum([实发金额]) as 实发金额 into GZ21 from GZ where   部门单位  like '%'+'" + bm + "'+'%' and substring(日期,1,7)='" + date.Substring(0, 7) + "'  group by 用工性质 ");
            list.Add(" if  exists (select name from sysobjects where name='GZ23')  drop table GZ23  ");
            list.Add(" select  sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴,sum([星级津贴]) as 星级津贴,sum([车贴]) as 车贴,sum([五项津贴]) as 五项津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发总额]) as 应发总额, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费,sum(五项扣款) as 五项扣款, sum([实发金额]) as 实发金额 into GZ23 from GZ where    部门单位  like '%'+'" + bm + "'+'%' and substring(日期,1,7)='" + date.Substring(0, 7) + "'  ");
            list.Add("   alter table GZ23  add  用工性质  varchar(10)  ");
            list.Add("   update GZ23 set 用工性质=' 总'  where 用工性质 is null ");
            list.Add("  insert into GZ21 select  用工性质,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴,  行车工津贴, 星级津贴,车贴,五项津贴, 卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发总额,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费, 五项扣款, 实发金额 from GZ23  ");
            //list.Add("   ");
            //list.Add("   ");

            return DbHelperSQL.ExecuteSqlTran(list);
        }
        /// <summary>
        /// 本部三种用工按性质打印
        /// </summary>
        public int SumGZBYBMBB( string date)
        {
            List<String> list = new List<string>();
            list.Add(" if  exists (select name from sysobjects where name='GZ21')  drop table GZ21 ");
            list.Add(" select  用工性质, sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发]) as 应发, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum([实发]) as 实发 into GZ21 from GZ where   (部门单位='特钢机关' or 部门单位='型钢厂'   or  部门单位='新安特' or  部门单位='工贸') and    (用工性质='固'  or 用工性质='制' or 用工性质 like '%合%'  )    and   substring(日期,1,7)='" + date.Substring(0, 7) + "'  group by 用工性质  ");
            list.Add(" if  exists (select name from sysobjects where name='GZ23')  drop table GZ23  ");
            list.Add("  select  sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发]) as 应发, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum([实发]) as 实发 into GZ23 from GZ where    (部门单位='特钢机关' or 部门单位='型钢厂'   or  部门单位='新安特' or  部门单位='工贸') and  (用工性质='固'  or 用工性质='制' or 用工性质 like '%合%'  )   and     substring(日期,1,7)='" + date.Substring(0, 7) + "'  ");
            list.Add("   alter table GZ23  add  用工性质 varchar(10) ");
            list.Add(" update GZ23 set 用工性质=' 总计'  where 用工性质 is null  ");
            list.Add(" insert into GZ21 select  用工性质,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴,  行车工津贴,  卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费,  实发 from GZ23  ");
            //list.Add("   ");
        
            return DbHelperSQL.ExecuteSqlTran(list);
        }
        /// <summary>
        /// 本部三种用工按性质打印22222
        /// </summary>
        public int SumGZBYBMBB_2(string date)
        {
            List<String> list = new List<string>();
            list.Add(" if  exists (select name from sysobjects where name='GZ21')  drop table GZ21 ");
            list.Add(" select  用工性质, sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([星级津贴]) as 星级津贴,sum([车贴]) as 车贴,sum([五项津贴]) as 五项津贴,sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发总额]) as 应发总额, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum(五项扣款) as 五项扣款,sum([实发金额]) as 实发金额 into GZ21 from GZ where   (部门单位='特钢机关' or 部门单位='型钢厂'   or  部门单位='新安特' or  部门单位='工贸') and    (用工性质='固'  or 用工性质='制' or 用工性质 like '%合%'  )    and   substring(日期,1,7)='" + date.Substring(0, 7) + "' group by 用工性质");
            list.Add(" if  exists (select name from sysobjects where name='GZ23')  drop table GZ23  ");
            list.Add("  select  sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴,sum([星级津贴]) as 星级津贴,sum([车贴]) as 车贴,sum([五项津贴]) as 五项津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发总额]) as 应发总额, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum(五项扣款) as 五项扣款,sum([实发金额]) as 实发金额 into GZ23 from GZ where    (部门单位='特钢机关' or 部门单位='型钢厂'   or  部门单位='新安特' or  部门单位='工贸') and  (用工性质='固'  or 用工性质='制' or 用工性质 like '%合%'  )   and     substring(日期,1,7)='" + date.Substring(0, 7) + "'  ");
            list.Add("  alter table GZ23  add  用工性质 varchar(10)  ");
            list.Add("  update GZ23 set 用工性质=' 总计'  where 用工性质 is null ");
            list.Add("  insert into GZ21 select  用工性质,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴,  行车工津贴, 星级津贴,车贴,五项津贴, 卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发总额,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费,五项扣款 ,  实发金额 from GZ23  ");

            return DbHelperSQL.ExecuteSqlTran(list);
        }
        /// <summary>
        /// 本部用工按性质打印
        /// </summary>
        public DataSet GetListGZSUMBYBMBB()
        {
            StringBuilder strSql = new StringBuilder();


            strSql.Append(" select 用工性质,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴, 0 as 行车工津贴,  卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费,  实发 from GZ21  order by 用工性质 desc ");


            return DbHelperSQL.Query(strSql.ToString(), null);

        }
        /// <summary>
        /// 本部用工按性质打印22222
        /// </summary>
        public DataSet GetListGZSUMBYBMBB_2()
        {
            StringBuilder strSql = new StringBuilder();


            strSql.Append(" select   * from GZ21   order by 用工性质 desc ");


            return DbHelperSQL.Query(strSql.ToString(), null);

        }
        /// <summary>
        /// 本部用工按单位打印
        /// </summary>
        public int SumGZBYDWBB(string date)
        {
            List<String> list = new List<string>();
            list.Add("  if  exists (select name from sysobjects where name='GZ21')  drop table GZ21 ");
            list.Add("  select  部门单位, sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发]) as 应发, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum([实发]) as 实发 into GZ21 from GZ where   (部门单位='特钢机关' or 部门单位='型钢厂'  or  部门单位='新安特' or  部门单位='工贸')  and  (用工性质='固'  or 用工性质='制' or 用工性质 like '%合%'  )   and   substring(日期,1,7)='" + date.Substring(0, 7) + "' group by 部门单位   ");
            list.Add(" if  exists (select name from sysobjects where name='GZ23')  drop table GZ23  ");
            list.Add(" select  sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发]) as 应发, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum([实发]) as 实发 into GZ23 from GZ where    (部门单位='特钢机关' or 部门单位='型钢厂'   or  部门单位='新安特' or  部门单位='工贸')  and  (用工性质='固'  or 用工性质='制' or 用工性质 like '%合%'  )  and     substring(日期,1,7)='" + date.Substring(0, 7) + "'   ");
            list.Add("  alter table GZ23  add  部门单位  varchar(10) ");
            list.Add("  update GZ23 set 部门单位=' 总计'  where 部门单位 is null  ");
            list.Add(" insert into GZ21 select  部门单位,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴,  行车工津贴,  卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费,  实发 from GZ23   ");
            //list.Add("   ");

            return DbHelperSQL.ExecuteSqlTran(list);
        }
        /// <summary>
        /// 本部用工按单位打印2
        /// </summary>
        public int SumGZBYDWBB_2(string date)
        {
            List<String> list = new List<string>();
            list.Add(" if  exists (select name from sysobjects where name='GZ21')  drop table GZ21   ");
            list.Add("   select  部门单位, sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴,sum([星级津贴]) as 星级津贴,sum([车贴]) as 车贴,sum([五项津贴]) as 五项津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发总额]) as 应发总额, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费,sum(五项扣款) as 五项扣款, sum([实发金额]) as 实发金额 into GZ21 from GZ where   (部门单位='特钢机关' or 部门单位='型钢厂'  or  部门单位='新安特' or  部门单位='工贸')  and  (用工性质='固'  or 用工性质='制' or 用工性质 like '%合%'  )   and   substring(日期,1,7)='" + date.Substring(0, 7) + "' group by 部门单位 ");
            list.Add(" if  exists (select name from sysobjects where name='GZ23')  drop table GZ23  ");
            list.Add(" select  sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴,sum([星级津贴]) as 星级津贴,sum([车贴]) as 车贴,sum([五项津贴]) as 五项津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发总额]) as 应发总额, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum(五项扣款) as 五项扣款,sum([实发金额]) as 实发金额 into GZ23 from GZ where    (部门单位='特钢机关' or 部门单位='型钢厂'   or  部门单位='新安特' or  部门单位='工贸')  and  (用工性质='固'  or 用工性质='制' or 用工性质 like '%合%'  )  and     substring(日期,1,7)='" + date.Substring(0, 7) + "'    ");
            list.Add(" alter table GZ23  add  部门单位  varchar(10)  ");
            list.Add("   update GZ23 set 部门单位=' 总计'  where 部门单位 is null  ");
            list.Add("  insert into GZ21 select  部门单位,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴,  行车工津贴,星级津贴,车贴,五项津贴,  卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发总额,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费, 五项扣款 , 实发金额 from GZ23  ");

            return DbHelperSQL.ExecuteSqlTran(list);
        }
        /// <summary>
        /// 本部用工按单位打印
        /// </summary>
        public DataSet GetListSumGZBYDWBB()
        {
            StringBuilder strSql = new StringBuilder();


            strSql.Append(" select * from GZ21  order by 部门单位 desc  ");


            return DbHelperSQL.Query(strSql.ToString(), null);

        }
        /// <summary>
        /// 除锻造外所有单位
        /// </summary>
        public int SumGZNOTDZ(string date)
        {
            List<String> list = new List<string>();
            list.Add("   if  exists (select name from sysobjects where name='GZ21')  drop table GZ21 ");
            list.Add(" select  用工性质, sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发]) as 应发, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum([实发]) as 实发 into GZ21 from GZ where   not(部门单位='锻造厂')   and   substring(日期,1,7)='" + date.Substring(0, 7) + "' group by 用工性质   ");
            list.Add("  if  exists (select name from sysobjects where name='GZ23')  drop table GZ23 ");
            list.Add(" select  sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发]) as 应发, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费, sum([实发]) as 实发 into GZ23 from GZ where    not(部门单位='锻造厂')  and     substring(日期,1,7)='" + date.Substring(0, 7) + "'   ");
            list.Add(" alter table GZ23  add  用工性质  varchar(10)  ");
            list.Add("  update GZ23 set 用工性质=' 总'  where 用工性质 is null  ");
            list.Add(" insert into GZ21 select  用工性质,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴,  行车工津贴,  卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费,  实发 from GZ23   ");
            
            return DbHelperSQL.ExecuteSqlTran(list);
        }
        /// <summary>
        /// 除锻造外所有单位2222
        /// </summary>
        public int SumGZNOTDZ_2(string date)
        {
            List<String> list = new List<string>();
            list.Add("   if  exists (select name from sysobjects where name='GZ21')  drop table GZ21 ");
            list.Add("   select  用工性质, sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴,sum([星级津贴]) as 星级津贴,sum([车贴]) as 车贴,sum([五项津贴]) as 五项津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发总额]) as 应发总额, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费,sum (五项扣款) as 五项扣款, sum([实发金额]) as 实发金额 into GZ21 from GZ where   not(部门单位='锻造厂')   and   substring(日期,1,7)='" + date.Substring(0, 7) + "' group by 用工性质   ");
            list.Add("  if  exists (select name from sysobjects where name='GZ23')  drop table GZ23  ");
            list.Add("   select  sum(人数) as 人数, sum(技能工资) as 技能工资, SUM([岗位工资]) as 岗位工资, sum([绩效工资]) as 绩效工资,  sum([三项补贴]) as 三项补贴, sum([回贴]) as 回贴, sum([工龄津贴]) as 工龄津贴, sum([职称津贴]) as 职称津贴, sum([特岗津贴]) as 特岗津贴, sum([行车工津贴]) as 行车工津贴,sum([星级津贴]) as 星级津贴,sum([车贴]) as 车贴,sum([五项津贴]) as 五项津贴, sum([卫生纸费]) as 卫生纸费,  sum([中晚班费]) as 中晚班费,  sum([加班工资]) as 加班工资 , sum([补发]) as 补发,  sum([扣事假工资]) as 扣事假工资,  sum([扣病假工资]) as 扣病假工资,  sum([其它扣款]) as 其它扣款, sum([应发总额]) as 应发总额, sum([扣失业保险]) as 扣失业保险, sum([扣养老金]) as 扣养老金, sum([扣医疗保险]) as 扣医疗保险, sum([扣公积金]) as 扣公积金, sum([扣电视费]) as 扣电视费, sum([扣治安费]) as 扣治安费, sum([扣会费]) as 扣会费, sum([扣互助金]) as 扣互助金, sum([扣丧葬费]) as 扣丧葬费,sum(五项扣款) as 五项扣款, sum([实发金额]) as 实发金额 into GZ23 from GZ where    not(部门单位='锻造厂')  and     substring(日期,1,7)='" + date.Substring(0, 7) + "'    ");
            list.Add("   alter table GZ23  add  用工性质  varchar(10)   ");
            list.Add("  update GZ23 set 用工性质=' 总'  where 用工性质 is null  ");
            list.Add(" insert into GZ21 select  用工性质,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴,  行车工津贴, 星级津贴,车贴,五项津贴, 卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发总额,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费, 五项扣款 , 实发金额 from GZ23   ");
            
            return DbHelperSQL.ExecuteSqlTran(list);
        }
        /// <summary>
        /// 除锻造外所有单位
        /// </summary>
        public DataSet GetListSumGZNOTDZ()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append(" select 用工性质,  人数,  技能工资,  岗位工资,  绩效工资,  三项补贴,  回贴,  工龄津贴,  职称津贴,  特岗津贴,0 as  行车工津贴,  卫生纸费,   中晚班费,   加班工资 ,  补发,   扣事假工资,   扣病假工资,   其它扣款,  应发,  扣失业保险,  扣养老金,  扣医疗保险,  扣公积金,  扣电视费,  扣治安费,  扣会费,  扣互助金,  扣丧葬费,  实发 from GZ21  order by 用工性质 desc    ");
            return DbHelperSQL.Query(strSql.ToString(), null);

        }
        /// <summary>
        /// 除锻造外所有单位222222
        /// </summary>
        public DataSet GetListSumGZNOTDZ_2()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append(" select * from GZ21  order by 用工性质 desc    ");
            return DbHelperSQL.Query(strSql.ToString(), null);

        }
        /// <summary>
        /// 各部门申请表打印1
        /// </summary>
        public int SQBunit1(String bm, string thisdate,String  lastdate)
        {
            int rowsAffected = 0;
            int i;
            IDataParameter[] iData = new SqlParameter[3];
            iData[0] = new SqlParameter("@lastdate", lastdate.Substring(0, 7));
            iData[1] = new SqlParameter("@thisdate", thisdate.Substring(0, 7));
            iData[2] = new SqlParameter("@bm", bm);
            i = DbHelperSQL.RunProcedure("pro_SQB_Unit1", iData, out rowsAffected);
            return i;

        }
        /// <summary>
        /// 本部申请表打印1
        /// </summary>
        public int SQBBB1(String bm, string thisdate, String lastdate)
        {
            int rowsAffected = 0;
            int i;
            IDataParameter[] iData = new SqlParameter[3];
            iData[0] = new SqlParameter("@lastdate", lastdate.Substring(0, 7));
            iData[1] = new SqlParameter("@thisdate", thisdate.Substring(0, 7));
            iData[2] = new SqlParameter("@bm", bm);
            i = DbHelperSQL.RunProcedure("pro_SQB_BB1", iData, out rowsAffected);
            return i;

        }
        /// <summary>
        /// 各部门申请表打印2
        /// </summary>
        public int SQBunit2(String bm, string thisdate, String lastdate)
        {
            int rowsAffected = 0;
            int i;
            IDataParameter[] iData = new SqlParameter[3];
            iData[0] = new SqlParameter("@lastdate", lastdate.Substring(0, 7));
            iData[1] = new SqlParameter("@thisdate", thisdate.Substring(0, 7));
            iData[2] = new SqlParameter("@bm", bm);
            i = DbHelperSQL.RunProcedure("pro_SQB_Unit2", iData, out rowsAffected);
            return i;

        }
        /// <summary>
        /// 本部申请表打印2
        /// </summary>
        public int SQBBB2(String bm, string thisdate, String lastdate)
        {
            int rowsAffected = 0;
            int i;
            IDataParameter[] iData = new SqlParameter[3];
            iData[0] = new SqlParameter("@lastdate", lastdate.Substring(0, 7));
            iData[1] = new SqlParameter("@thisdate", thisdate.Substring(0, 7));
            iData[2] = new SqlParameter("@bm", bm);
            i = DbHelperSQL.RunProcedure("pro_SQB_BB2", iData, out rowsAffected);
            return i;

        }
        /// <summary>
        /// 各部门申请表打印3
        /// </summary>
        public int SQBunit3(String bm, string thisdate, String lastdate)
        {
            int rowsAffected = 0;
            int i;
            IDataParameter[] iData = new SqlParameter[3];
            iData[0] = new SqlParameter("@lastdate", lastdate.Substring(0, 7));
            iData[1] = new SqlParameter("@thisdate", thisdate.Substring(0, 7));
            iData[2] = new SqlParameter("@bm", bm);
            i = DbHelperSQL.RunProcedure("pro_SQB_Unit3", iData, out rowsAffected);
            return i;

        }
        /// <summary>
        /// 本部申请表打印3
        /// </summary>
        public int SQBBB3(String bm, string thisdate, String lastdate)
        {
            int rowsAffected = 0;
            int i;
            IDataParameter[] iData = new SqlParameter[3];
            iData[0] = new SqlParameter("@lastdate", lastdate.Substring(0, 7));
            iData[1] = new SqlParameter("@thisdate", thisdate.Substring(0, 7));
            iData[2] = new SqlParameter("@bm", bm);
            i = DbHelperSQL.RunProcedure("pro_SQB_BB3", iData, out rowsAffected);
            return i;

        }
        /// <summary>
        /// 各部门申请表打印4
        /// </summary>
        public int SQBunit4(String bm, string thisdate, String lastdate)
        {
            int rowsAffected = 0;
            int i;
            IDataParameter[] iData = new SqlParameter[3];
            iData[0] = new SqlParameter("@lastdate", lastdate.Substring(0, 7));
            iData[1] = new SqlParameter("@thisdate", thisdate.Substring(0, 7));
            iData[2] = new SqlParameter("@bm", bm);
            i = DbHelperSQL.RunProcedure("pro_SQB_Unit4", iData, out rowsAffected);
            return i;

        }
        /// <summary>
        /// 本部申请表打印4
        /// </summary>
        public int SQBBB4(String bm, string thisdate, String lastdate)
        {
            int rowsAffected = 0;
            int i;
            IDataParameter[] iData = new SqlParameter[3];
            iData[0] = new SqlParameter("@lastdate", lastdate.Substring(0, 7));
            iData[1] = new SqlParameter("@thisdate", thisdate.Substring(0, 7));
            iData[2] = new SqlParameter("@bm", bm);
            i = DbHelperSQL.RunProcedure("pro_SQB_BB4", iData, out rowsAffected);
            return i;

        }
        /// <summary>
        /// 各部门申请表打印5
        /// </summary>
        public int SQBunit5(String bm, string thisdate, String lastdate)
        {
            int rowsAffected = 0;
            int i;
            IDataParameter[] iData = new SqlParameter[3];
            iData[0] = new SqlParameter("@lastdate", lastdate.Substring(0, 7));
            iData[1] = new SqlParameter("@thisdate", thisdate.Substring(0, 7));
            iData[2] = new SqlParameter("@bm", bm);
            i = DbHelperSQL.RunProcedure("pro_SQB_Unit5", iData, out rowsAffected);
            return i;

        }
        public int SQBunit6()
        {
            List<String> list = new List<string>();

            list.Add("alter table GZ_SQB  add  小计1  Decimal(18,1), 小计2  Decimal(18,2)  ");
            list.Add("update GZ_SQB set 小计1 =[技能工资]+ [岗位工资]+ [绩效工资]+ [三项补贴]+ [回贴]+[工龄津贴]+[职称津贴]+[特岗津贴]+ [卫生纸费] ,小计2=[扣事假工资]+[扣病假工资]+[其它扣款]  ");
            return DbHelperSQL.ExecuteSqlTran(list);
        }
        public DataSet GetSQBunit()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select   * from GZ_SQB   order by ID  Asc   ");
            return DbHelperSQL.Query(strSql.ToString(), null);
        }
    }
}
